#include <stdio.h>
#include <stdlib.h>

// Define a class-like structure for Point using macros
#define CLASS(Point) \
    struct Point {   \
        int x;       \
        int y;       \
        void (*print)(struct Point*); \
    }; \

// Define a constructor for the Point class
#define CONSTRUCTOR(Point, x_value, y_value) \
    struct Point* Point##_create() { \
        struct Point* obj = (struct Point*)malloc(sizeof(struct Point)); \
        obj->x = x_value; \
        obj->y = y_value; \
        obj->print = Point##_print; \
        return obj; \
    } \

// Define a method for the Point class
#define METHOD(Point, method_body) \
    void Point##_print(struct Point* self) { \
        method_body \
    } \

int main() {
    CLASS(Point);  // Define the Point class
    CONSTRUCTOR(Point, 3, 4);  // Define the constructor

    // Define the method for the Point class
    METHOD(Point, {
        printf("Point: (%d, %d)\n", self->x, self->y);
    });

    // Create an instance of Point
    struct Point* point = Point_create();

    // Call the method
    point->print(point);

    // Clean up
    free(point);

    return 0;
}